package net.controller;

import net.bo.KUtilisateur;
import net.technics.ClassTechnics;

public class KValidateParams extends KValidateRegister {

	@Override
	public void validateLogin() {
		String login = getValue("login");
		KUtilisateur user = ClassTechnics.getActiveUser(request);
		if (!user.getLogin().equals(login) && existsLogin()) {
			setOnError(true);
		}
	}

	@Override
	protected void onError(String fieldName) {
		if ("login".equals(fieldName)) {
			displayError("Ce login existe déjà");
		}
	}

	@Override
	protected void onValid(String fieldName) {
		// TODO Auto-generated method stub

	}

}
